1.     

2.   

DROP TABLE IF EXISTS `dle_shop_orders`;
CREATE TABLE `dle_shop_orders` (
  `id` int(7) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) DEFAULT NULL,
  `email` varchar(50) DEFAULT NULL,
  `clientinfo` varchar(255) DEFAULT NULL,
  `orderdata` text,
  `summa` int(5) DEFAULT '0',
  `status` tinyint(1) DEFAULT '0',
  `buystatus` tinyint(1) DEFAULT '0',
  `date` datetime DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=51 DEFAULT CHARSET=cp1251;

INSERT INTO `dle_admin_sections` (`name`, `title`, `descr`, `icon`, `allow_groups`) VALUES ('shop', ' ', 'by imperator', 'tools.png', '1');

ALTER TABLE `dle_post` ADD `price` DOUBLE( 7, 2 ) DEFAULT '0';



3.  

: index.php


$tpl->load_template ( 'main.tpl' );

 
$shopaction = "index.php";
require ROOT_DIR . '/engine/modules/shopinclude.php';

: engine\engine.php



switch ( $do ) {

 

	case "shoprecycle" :
		include ENGINE_DIR . '/modules/shoprecycle.php';
		break;

 (      17  )

full_story, xfields, title,

 

full_story, xfields, price, title,


: engine\modules\show.short.php ,       : engine\modules\show.full.php


$tpl->compile( 'content' );

 
$shopaction = "view";
require ROOT_DIR . '/engine/modules/shopinclude.php';

: engine\inc\addnews.php



echo $output;

 

if ($member_id['user_group']==1) {
echo <<<HTML
    <tr>
        <td height="29" style="padding-left:5px;"> </td>
        <td><input class="edit bk" type="text" size="55" name="price" id="title"> .
		</td>
    </tr>
HTML;
}



	$db->query( "INSERT INTO " . PREFIX . "_post (date, autor, short_story, full_story, xfields, title, descr, keywords, category, alt_name, allow_comm, approve, allow_main, fixed, allow_rate, allow_br, votes, access, symbol, flag, tags, metatitle, price) values ('$thistime', '{$member_id['name']}', '$short_story', '$full_story', '$filecontents', '$title', '{$metatags['description']}', '{$metatags['keywords']}', '$category_list', '$alt_name', '$allow_comm', '$approve', '$allow_main', '$news_fixed', '$allow_rating', '$allow_br', '$add_vote', '$group_regel', '$catalog_url', '1', '{$_POST['tags']}', '{$metatags['title']}')" );

 

	$_POST['price'] = str_replace(',','.',floatval($_POST['price']));
	$db->query( "INSERT INTO " . PREFIX . "_post (date, autor, short_story, full_story, xfields, title, descr, keywords, category, alt_name, allow_comm, approve, allow_main, fixed, allow_rate, allow_br, votes, access, symbol, flag, tags, metatitle, price) values ('$thistime', '{$member_id['name']}', '$short_story', '$full_story', '$filecontents', '$title', '{$metatags['description']}', '{$metatags['keywords']}', '$category_list', '$alt_name', '$allow_comm', '$approve', '$allow_main', '$news_fixed', '$allow_rating', '$allow_br', '$add_vote', '$group_regel', '$catalog_url', '1', '{$_POST['tags']}', '{$metatags['title']}', '".$_POST['price']."')" );

: engine\inc\editnews.php



echo $output;

 

if ($member_id['user_group']==1) {
echo <<<HTML
    <tr>
        <td height="29" style="padding-left:5px;"> </td>
        <td><input class="edit bk" type="text" size="55" name="price" id="price" value="$row[price]"> .
		</td>
    </tr>
HTML;
}



				$added_time = time() + ($config['date_adjust'] * 60);
				$newdate = $_POST['newdate'];

 

				$_POST['price'] = str_replace(',','.',floatval($_POST['price']));



	$result = $db->query( "UPDATE " . PREFIX . "_post set title='$title', date='$thistime', short_story='$short_story', full_story='$full_story', xfields='$filecontents', descr='{$metatags['description']}', keywords='{$metatags['keywords']}', category='$category_list', alt_name='$alt_name', allow_comm='$allow_comm', approve='$approve', allow_main='$allow_main', allow_rate='$allow_rating', fixed='$news_fixed', allow_br='$allow_br', votes='$add_vote', access='$group_regel', symbol='$catalog_url', flag='1', editdate='$added_time', editor='{$member_id['name']}', reason='$editreason', view_edit='$view_edit', tags='{$_POST['tags']}', metatitle='{$metatags['title']}' WHERE id='$item_db[0]'" );

 

	$result = $db->query( "UPDATE " . PREFIX . "_post set title='$title', date='$thistime', short_story='$short_story', full_story='$full_story', xfields='$filecontents', descr='{$metatags['description']}', keywords='{$metatags['keywords']}', category='$category_list', alt_name='$alt_name', allow_comm='$allow_comm', approve='$approve', allow_main='$allow_main', allow_rate='$allow_rating', fixed='$news_fixed', allow_br='$allow_br', votes='$add_vote', access='$group_regel', symbol='$catalog_url', flag='1', editdate='$added_time', editor='{$member_id['name']}', reason='$editreason', view_edit='$view_edit', tags='{$_POST['tags']}', metatitle='{$metatags['title']}', price='{$_POST['price']}' WHERE id='$item_db[0]'" );



	$result = $db->query( "UPDATE " . PREFIX . "_post set title='$title', short_story='$short_story', full_story='$full_story', xfields='$filecontents', descr='{$metatags['description']}', keywords='{$metatags['keywords']}', category='$category_list', alt_name='$alt_name', allow_comm='$allow_comm', approve='$approve', allow_main='$allow_main', allow_rate='$allow_rating', fixed='$news_fixed', allow_br='$allow_br', votes='$add_vote', access='$group_regel', symbol='$catalog_url', editdate='$added_time', editor='{$member_id['name']}', reason='$editreason', view_edit='$view_edit', tags='{$_POST['tags']}', metatitle='{$metatags['title']}' WHERE id='$item_db[0]'" );

 

	$result = $db->query( "UPDATE " . PREFIX . "_post set title='$title', short_story='$short_story', full_story='$full_story', xfields='$filecontents', descr='{$metatags['description']}', keywords='{$metatags['keywords']}', category='$category_list', alt_name='$alt_name', allow_comm='$allow_comm', approve='$approve', allow_main='$allow_main', allow_rate='$allow_rating', fixed='$news_fixed', allow_br='$allow_br', votes='$add_vote', access='$group_regel', symbol='$catalog_url', editdate='$added_time', editor='{$member_id['name']}', reason='$editreason', view_edit='$view_edit', tags='{$_POST['tags']}', metatitle='{$metatags['title']}', price='{$_POST['price']}' WHERE id='$item_db[0]'" );


4. 

 main.tpl

 

{clean}
[shop_recycle]
<div id="popular" class="block">
	<div class="dtop">&nbsp;</div>
	<div class="dcont">
	
		<div class="btl">
			<h4> </h4>
		</div>
		<ul>
<div style="padding:10px">
- : {article_count}<br />
: {article_summa} .<br /><br />
<a href="/?do=shoprecycle"> / </a><br />
<a href="#" onclick="DoClearArticle(); return false;"> </a><br />
</div>
		</ul>
	</div>
	<div class="dbtm">&nbsp;</div>
</div>
[/shop_recycle]

 shortstory.tpl, fullstory.tpl

 

[shop]
<p><br />
: {price} .<br />
<a href="#" onclick="DoAddArticle('{news-id}'); return false;">  </a>
</p>
[/shop]

 